<?php
/**
 * Templater
 * 
 * @author RiderSx
 */
class xineForumTemplater {
	protected $_theme, $_template = '';
	
	public $assigns = array();
	
	public function header ($theme) {
		$this->_theme = $theme;
		
		include DIR.'/../design/'.$this->_theme.'/header.html';
	}
	
	public function assign ($data=array()) {
		foreach($data as $k => $v) {
			$this->assigns[$k] = $v;
		}
		return $this;
	}
	
	public function single ($template, $assigns=array()) {
		if($assigns) $this->assigns = array_merge($this->assigns, $assigns);
		
		include DIR.'/../design/'.$this->_theme.'/'.$template.'.html';
	}
	
	public function footer () {
		include DIR.'/../design/'.$this->_theme.'/footer.html';
	}
	
	public function __get ($key) {
		echo $this->assigns[$key];
	}
}